import request from '@/router/axios';

export const getTraceabilityRecord = (params) => {
  return request({
    url: '/api/mes-product/productiontrace/list',
    method: 'get',
    params: params
  });
};

export const getDateCodeList = (params) => {
  return request({
    url: '/api/mes-warehouse/packing-material/date-code/list-by-part-no',
    method: 'get',
    params: params
  });
};

export const getVendorLotNoList = (params) => {
  return request({
    url: '/api/mes-warehouse/packing-material/vendor-lot-no/list-by-part-no',
    method: 'get',
    params: params
  });
};

export const getLotNoList = (params) => {
  return request({
    url: '/api/mes-warehouse/packing-material/lot-no/list-by-part-no',
    method: 'get',
    params: params
  });
};

export const getPartInfo = (params) => {
  return request({
    url: '/api/mes-product/reverse-trace/material-info/multi-condition-query/page',
    method: 'get',
    params
  });
};

export const getworkOrderUseInfo = (current, size, params) => {
  return request({
    url: '/api/mes-product/reverse-trace/work-order-usage-info/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getInspectionInfo = (params) => {
  return request({
    url: '/api/mes-abacus/production-trace/reverse-inspection-info',
    method: 'get',
    params
  });
};

export const getViewSettingList = (code) => {
  return request({
    url: `/api/mes-admin/page-element-config/list-by-code?code=${code}`,
    method: 'post'
  });
};
